CFLAGS=-g

SOURCES=clearerr.c fclose.c feof.c ferror.c fflush.c fgets.c fopen.c fprintf.c \
		fputs.c fputc.c fread.c freopen.c fscanf.c fseek.c fsetpos.c ftell.c \
		fwrite.c getc.c getchar.c gets.c perror.c printf.c putc.c putchar.c puts.c \
		putchar.c puts.c remove.c rename.c rewind.c scanf.c setbuf.c setvbuf.c \
		sprintf.c sscanf.c tmpfile.c tmpnam.c ungetc.c vfprintf.c vprintf.c vsprintf.c

PROGRAMS=$(SOURCES:.c=)

all: ${PROGRAMS}

clearerr: clearerr.c
	${CC} ${CFLAGS} -o $@ $<   
fclose: fclose.c
	${CC} ${CFLAGS} -o $@ $< 
feof: feof.c
	${CC} ${CFLAGS} -o $@ $<  
ferror: ferror.c
	${CC} ${CFLAGS} -o $@ $<  
fflush: fflush.c
	${CC} ${CFLAGS} -o $@ $<  
fgets: fgets.c
	${CC} ${CFLAGS} -o $@ $<  
fopen: fopen.c
	${CC} ${CFLAGS} -o $@ $<  
fprintf: fprintf.c
	${CC} ${CFLAGS} -o $@ $<  
fputs: fputs.c
	${CC} ${CFLAGS} -o $@ $<  
fputc: fputc.c
	${CC} ${CFLAGS} -o $@ $<   
fread: fread.c
	${CC} ${CFLAGS} -o $@ $< 
freopen: freopen.c
	${CC} ${CFLAGS} -o $@ $<  
fscanf: fscanf.c
	${CC} ${CFLAGS} -o $@ $<  
fseek: fseek.c
	${CC} ${CFLAGS} -o $@ $<  
fsetpos: fsetpos.c
	${CC} ${CFLAGS} -o $@ $<  
ftell: ftell.c
	${CC} ${CFLAGS} -o $@ $<  
fwrite: fwrite.c
	${CC} ${CFLAGS} -o $@ $<  
getc: getc.c
	${CC} ${CFLAGS} -o $@ $<
getchar: getchar.c
	${CC} ${CFLAGS} -o $@ $<   
gets: gets.c
	${CC} ${CFLAGS} -o $@ $< 
perror: perror.c
	${CC} ${CFLAGS} -o $@ $<  
printf: printf.c
	${CC} ${CFLAGS} -o $@ $<  
putc: putc.c
	${CC} ${CFLAGS} -o $@ $<  
putchar: putchar.c
	${CC} ${CFLAGS} -o $@ $<  
puts: puts.c
	${CC} ${CFLAGS} -o $@ $<  
putchar: putchar.c
	${CC} ${CFLAGS} -o $@ $<  
puts: puts.c
	${CC} ${CFLAGS} -o $@ $<
remove: remove.c
	${CC} ${CFLAGS} -o $@ $<   
rename: rename.c
	${CC} ${CFLAGS} -o $@ $< 
rewind: rewind.c
	${CC} ${CFLAGS} -o $@ $<  
scanf: scanf.c
	${CC} ${CFLAGS} -o $@ $<  
setbuf: setbuf.c
	${CC} ${CFLAGS} -o $@ $<  
setvbuf: setvbuf.c
	${CC} ${CFLAGS} -o $@ $<  
sprintf: sprintf.c
	${CC} ${CFLAGS} -o $@ $<  
sscanf: sscanf.c
	${CC} ${CFLAGS} -o $@ $<  
tmpfile: tmpfile.c
	${CC} ${CFLAGS} -o $@ $<
tmpnam: tmpnam.c
	${CC} ${CFLAGS} -o $@ $<  
ungetc: ungetc.c
	${CC} ${CFLAGS} -o $@ $<  
vfprintf: vfprintf.c
	${CC} ${CFLAGS} -o $@ $<
vprintf: vprintf.c
	${CC} ${CFLAGS} -o $@ $<  
vsprintf: vsprintf.c
	${CC} ${CFLAGS} -o $@ $<  

clean:
	rm -rf ${PROGRAMS}
